@echo off
call :time_tmp time_tmp
set time_tmp=%time_tmp: =0%
echo %time_tmp%

exit /b %errorlevel%
:time_tmp
set Y=%date:~0,4%
set m=%date:~5,2%
set d=%date:~8,2%
set H=%time:~0,2%
set i=%time:~3,2%
set s=%time:~6,2%
set %~1=%Y%-%m%-%d%-%H%_%i%_%s%
exit /b 0